import "babel-polyfill"
import Vue from "vue"
import Antd from "ant-design-vue"
import App from "./App.vue"
import router from "./router"
import store from "./store"
import "ant-design-vue/dist/antd.css"
import "assets/css/index.less" //顺序不可改变，不然打包过后，样式会乱
import "assets/js/filter"
Vue.use(Antd)
Vue.config.productionTip = false
// import sselect from "components/form/select"
// Vue.component(sselect.name, sselect)
// import smodal from "components/base/modal"
// Vue.component(smodal.name, smodal)
// import sectionTitle from 'components/base/sectionTitle'
// Vue.component('sectionTitle', sectionTitle)
import component from "./components"
for (const key in component) {
  Vue.component(key, component[key])
}
import { message, Modal } from "ant-design-vue"
Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message
let error = message.error
Vue.prototype.$message.error = (...theArgs) => {
  Vue.prototype.$message.destroy()
  error(...theArgs)
}
let success = message.success
Vue.prototype.$message.success = (...theArgs) => {
  Vue.prototype.$message.destroy()
  success(...theArgs)
}
let warning = message.warning
Vue.prototype.$message.warning = (...theArgs) => {
  Vue.prototype.$message.destroy()
  warning(...theArgs)
}
Vue.prototype.$message.$error = error
Vue.prototype.$info = Modal.info
Vue.prototype.$success = Modal.success
Vue.prototype.$error = Modal.error
Vue.prototype.$warning = Modal.warning
Array.prototype.remove = function(val) {
  var index = this.indexOf(val)
  if (index > -1) {
    this.splice(index, 1)
  }
}
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app")
